#!/bin/bash - 
#===============================================================================
#
#          FILE:  start_isimsrv.sh
# 
#         USAGE:  ./start_isimsrv.sh 
# 
#   DESCRIPTION:  

# 
#       OPTIONS:  ---
#  REQUIREMENTS:  ---
#          BUGS:  ---
#         NOTES:  ---
#        AUTHOR: wgwang (), wg93.wang@gmail.com
#       COMPANY: 
#       CREATED: 2012年01月02日 22时38分15秒 CST
#      REVISION:  ---
#===============================================================================

set -o nounset                              # Treat unset variables as an error


cd ${0%/*}
shdir=$PWD

mkdir -p $shdir/logs
mkdir -p $shdir/status

PYTHON='python2.6'


pid=`cat $shdir/status/isimsrv.pid`
kill $pid
sleep 1
ps -P $pid | grep python
ret=$?
while (( $ret == 0 ))
do
    kill $pid 
    sleep 1
    ps -P $pid | grep python 
    ret=$?
done

$PYTHON $shdir/isimsrv.py > $shdir/logs/start_isimsrv.log 2>&1


